package cn.fxl.basic.utils;

import cn.fxl.user.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/**")
                //文件上传
                .excludePathPatterns("/fastDfs/**")
                //登录
                .excludePathPatterns("/login/**")
                //用户注册,用户邮箱激活
                .excludePathPatterns("/user/register/**","/user/active/**")
                //验证码放行
                .excludePathPatterns("/verifyCode/**")
                //店铺注册
                .excludePathPatterns("/shop/settlement");
    }
}
